﻿@model MyMvcStoreApplication.Models.Album
@{
    var urlUnknownAlbum = Url.Content("~/Content/Images/unknown_album.jpg");
}
        <legend>Album</legend>

        @*hiddens*@
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.Likes)

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Artista)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.ArtistaId, new SelectList(ViewBag.ArtistasList, "ID", "Nombre", Model.ArtistaId), String.Empty)
            @Html.ValidationMessageFor(model => model.ArtistaId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Genero)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.GeneroId, new SelectList(ViewBag.GeneroList, "ID", "Nombre", Model.GeneroId), String.Empty)
            @Html.ValidationMessageFor(model => model.GeneroId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Likes)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Likes)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TapaAlbumURL)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TapaAlbumURL)
            <a id="loadimg" href="#">Cargar imagen</a>
            @Html.ValidationMessageFor(model => model.TapaAlbumURL)
        </div>
        
        <div class="editor-field">
            <img class="imgsmall" id="imgminiatura" alt="imagen miniatura" src="@((String.IsNullOrEmpty(Model.TapaAlbumURL)) ? @urlUnknownAlbum : @Model.TapaAlbumURL)"/>
        </div>